<div class="page-header">
    <h1>
        Detail Pembelian SN
        <small>
            <i class="icon-double-angle-right"></i>
            Detail Pembelian SN Agen
        </small>
    </h1>
</div>

<?php
if ($this->errmsg) {
    ?>
    <div class="alert alert-danger">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>

        <strong>
            <i class="icon-remove"></i>
            Error
        </strong>

        <?php echo $this->errmsg; ?>
        <br />
    </div>
    <?php
}

if ($this->msg) {
    ?>
    <div class="alert alert-info">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>

        <strong>
            <i class="icon-ok"></i>
        </strong>

        <?php echo $this->msg; ?>
        <br />
    </div>
    <?php
}

if (!$this->msg && !$this->errmsg) {
    ?>

    <div class="row">
        <div class="col-xs-11">
            <form id="formSN" class="form-horizontal" role="form" action="" method="post">
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="acc_num"> Tanggal Transaksi </label>

                    <div class="col-sm-9">
                        <input readonly="" type="text" id="trans_dtm" name="trans_dtm" value="<?php echo $this->data['trans_dtm']; ?>" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="acc_num"> Kode Transaksi </label>

                    <div class="col-sm-9">
                        <input readonly="" type="text" id="trans_dtm" name="trans_dtm" value="<?php echo $this->data['trans_code']; ?>" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="acc_num"> Dari Nomor Akun </label>

                    <div class="col-sm-9">
                        <input readonly="" type="text" id="acc_num" name="acc_num" placeholder="Nomor Akun" value="<?php echo $this->data['account_num1']; ?>" class="col-xs-10 col-sm-5" />
                    </div>
                </div>

            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right" for="tarik"> Jumlah Pembelian </label>

                <div class="col-sm-9">
                    <input type="text" id="tarik" name="tarik" class="col-xs-10 col-sm-5" value="<?php echo $this->data['jumlah']; ?>" readonly />
                </div>
            </div>
           
            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right" for="bank_name"> Total </label>

                <div class="col-sm-9">
                    <input type="text" id="bank_name" name="bank_name" class="col-xs-10 col-sm-5" value="<?php echo $this->data['amount1']; ?>" readonly />
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right" for="bank_name"> Cara Pembayaran </label>

                <div class="col-sm-9">
                    <input type="text" id="bank_name" name="bank_name" class="col-xs-10 col-sm-5" value="<?php echo $this->data['carabayar']; ?>" readonly />
                </div>
            </div>

            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <input type="hidden" name="transId" value="<?php echo $this->transId; ?>">
                    <input type="hidden" name="flag" id="flag" value="">
                    <button class="btn btn-info" type="button" onclick="btnClick('APPROVE')">
                        <i class="icon-ok bigger-110"></i>
                        Approve
                    </button>

                    &nbsp; &nbsp; &nbsp;
                    <button class="btn" type="button" onclick="btnClick('BATALKAN')">
                        <i class="icon-undo bigger-110"></i>
                        Batalkan
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>

<script>

    function btnClick(flag){
        $('#flag').val(flag);

        bootbox.confirm(flag+' Pembelian SN?', function(result) {
                if(result) {
                    $('#formSN').submit();
                }
        });
        
    }

</script>

<?php } ?>